/* eslint-disable @typescript-eslint/no-explicit-any */
type CommandHandler = (args?: any) => void;

const commands = new Map<string, CommandHandler>();

const CommandRegistry = {
  register: (command: string, handler: CommandHandler) => {
    commands.set(command, handler);
  },
  execute: (command: string, args?: any) => {
    const handler = commands.get(command);
    handler?.(args);
  },
};

export default CommandRegistry;
